"""
@-*- coding: utf-8 -*-
@ python: 3.12.3
@ 创建者: JacksonCode
@ 创建时间: 2025-11-14
"""
import requests
import time

headers = {
    "Accept": "application/json, text/plain, */*",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Pragma": "no-cache",
    "Referer": "http://123.156.231.144:8999/",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
    "enc": "false",
    "token": "null"
}
cookies = {
    "Hm_lvt_a1ff8825baa73c3a78eb96aa40325abc": "1762996181,1763083236",
    "Hm_lpvt_a1ff8825baa73c3a78eb96aa40325abc": "1763083236",
    "HMACCOUNT": "50AC8FFC6341318C"
}
url = "http://123.156.231.144:8999/prod-api/bigscreen/chargeStatusList"

start_time = time.time()

response = requests.get(url, headers=headers, verify=False)  # cookies=cookies,

# print(response.text)

ret_json = response.json()
# print(ret_json)

print(f"异常数量总共有: {len(ret_json['data']):.2f}\n")

for item_json in ret_json['data']:
    print(f"设备地址 {item_json['rtuAddress']} 插座 {item_json['meterName']} 异常使用状态 {item_json['usageStatus']} \n")

# print(type(ret_json))

end = time.time()
print(f"总运行时长:{end - start_time:.2f}")
